﻿using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
using Newtonsoft.Json;

namespace Devonline.Core
{
    /// <summary>
    /// 逻辑操作类型
    /// </summary>
    public enum OperatorType
    {
        /// <summary>
        /// = 等于 equal
        /// </summary>
        [JsonProperty("eq")]
        [JsonPropertyName("eq")]
        [Display(Name = "等于")]
        Equal,
        /// <summary>
        /// != 等于 not equal
        /// </summary>
        [JsonProperty("ne")]
        [JsonPropertyName("ne")]
        [Display(Name = "不等于")]
        NotEqual,
        /// <summary>
        /// > 大于 greater than
        /// </summary>
        [JsonProperty("lt")]
        [JsonPropertyName("or")]
        [Display(Name = "大于")]
        GreaterThan,
        /// <summary>
        /// > 大于等于 greater than and equal
        /// </summary>
        [JsonProperty("gte")]
        [JsonPropertyName("gte")]
        [Display(Name = "大于等于")]
        GreaterThanAndEqual,
        /// <summary>
        /// < 小于 less than
        /// </summary>
        [JsonProperty("lt")]
        [JsonPropertyName("lt")]
        [Display(Name = "小于")]
        LessThan,
        /// <summary>
        /// < 小于等于 less than and equal
        /// </summary>
        [JsonProperty("lte")]
        [JsonPropertyName("lte")]
        [Display(Name = "小于等于")]
        LessThanAndEqual,
        /// <summary>
        /// co 包含 contains
        /// </summary>
        [JsonProperty("co")]
        [JsonPropertyName("co")]
        [Display(Name = "包含")]
        Contains,
        /// <summary>
        /// sw 匹配开头 starts with, startswith
        /// </summary>
        [JsonProperty("sw")]
        [JsonPropertyName("sw")]
        [Display(Name = "匹配开头")]
        StartsWith,
        /// <summary>
        /// ew 匹配结尾 ends with, endswith
        /// </summary>
        [JsonProperty("ew")]
        [JsonPropertyName("ew")]
        [Display(Name = "匹配结尾")]
        EndsWith
    }
}
